<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
	trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="../admin.inc.jsp"%>
<script>
	function toSubmit() {		
		var obj = $("#upload");
		var form = $("#form_banner_add");
		form.submit();
	}
	function callback(success, msg) {
		if (success) {
			alertMsg.info(msg);
			$.pdialog.closeCurrent();
			// 刷新列表
			var tabId = getCurrentNavtab().attr("tabid");
			if (tabId != null) {
				navTab.reload("", {
					navTabId : ""
				});
			}
		}else{
			alertMsg.error(msg);
		}
	}

</script>
<div class="pageContent">
	<s:form name="myForm" id="form_banner_add" action="/admin/banner/add"
		method="POST" enctype="multipart/form-data" target="hidden_frame">
		<div class="pageFormContent" layoutH="58">
			<p>
				<label>城市：</label>
				<select id = "cityCode" name="banner.cityCode" class="required">
					<c:forEach var="item" items="${cityCodeList}">
		            	<option value="${item.configValue}" >${item.description}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>名称：</label>
				<input type="text" name="banner.name" >
			</p>
			
			<p>
				<label>类型：</label>
				<select id = "type" name="banner.bannerType" class="required">
					<option value="01" >首页</option>
				</select>
			</p>
			
			<p>
				<label>广告图：</label>
				<input type="file" name="image"
					id="image" />
			</p>
			
			<p>
				<label>URL：</label>
				<input type="text" name="banner.url" >
			</p>
			
			<p>
				<label>排序：</label>
				<input type="text" name="banner.orderIndex" >
			</p>
			
			<p class="nowrap">
				<label>富文本：</label>
				<textarea class="editor textInput" name="banner.richDesc" rows="10" cols="35" tools="Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Removeformat,Align,List,Outdent,Indent,Img,Hr,Source,Preview,Fullscreen"
			    uplinkurl="${webContextPath}/admin/rich/upload/image" uplinkext="zip,rar,txt" upimgurl="${webContextPath}/admin/rich/upload/image" upimgext="jpg,jpeg,gif,png"
			    style="display: none;"></textarea>
			</p>
		</div>
	</s:form>
	<div class="formBar">
		<ul>
			<li><div class="button">
					<div class="buttonContent">
						<button onclick="toSubmit()" type="button">确定</button>
					</div>
				</div></li>
			<li><div class="button">
					<div class="buttonContent">
						<button type="button" class="close">关闭</button>
					</div>
				</div></li>
		</ul>
	</div>
</div>
<iframe name='hidden_frame' id="hidden_frame" style='display: none'></iframe>